<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/7/11 0011
  Time: 下午 4:48
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<html>
<head>
    <title>Title</title>

    <script src="../../js/jquery-3.3.1.min.js" charset="utf-8"></script>
    <script src="../../js/cookie/jquery.cookie.js" charset="utf-8"></script>
    <script src="../../layui-v2.2.5/layui/layui.js" charset="utf-8"></script>
    <link rel="stylesheet" href="../../layui-v2.2.5/layui/css/layui.css" media="all">
</head>
<body>



<div style="margin-bottom: 42px;">
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:-38px;float:right;margin-right: 37px"  href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>


<table>
    <tr>
        <td style="width: 6rem"><span>已发放金额</span></td> <td style="width: 6rem"><span>${shareConfig.outMoney}</span></td>


        <td style="width: 6rem"><span>剩余金额</span></td> <td style="width: 6rem"><span>${shareConfig.totalMoney}</span></td>


        <td style="width: 6rem"><span>最大红包</span></td> <td style="width: 6rem"><span>${shareConfig.maxPrice}</span></td>


        <td style="width: 6rem"><span>最小红包</span></td> <td style="width: 6rem"> <span>${shareConfig.minPrice}</span></td>
    </tr>
</table>

<div>

    <table class="layui-table" style="top: 5rem" lay-data="{ url:'/group/generalizeInfoData?activityId=${activityId}', page:true, id:'idTest'}" lay-filter="demo">
        <thead>
        <tr>
            <th lay-data="{field:'id', width:180,  fixed: true}">订单ID</th>
            <th lay-data="{field:'createTime', width:180}">时间</th>
            <th lay-data="{field:'gainerName', width:150}">会员</th>
            <th lay-data="{field:'gainerTel', width:120, }">电话</th>
            <th lay-data="{field:'money', width:120}">金额</th>
        </tr>
        </thead>
    </table>

</div>



<script>

    layui.use('element', function(){
        var element = layui.element;
    });

    layui.use('table', function(){
        var table = layui.table;
        //监听表格复选框选择
        table.on('checkbox(demo)', function(obj){
            console.log(obj);
        });
        //监听工具条
        table.on('tool(demo)', function(obj){
            var data = obj.data;
            if(obj.event === 'detail'){
                layer.msg('ID：'+ data.id + ' 的查看操作');
            } else if(obj.event === 'del'){
                layer.confirm('真的删除行么', function(index){
                    obj.del();
                    layer.close(index);
                });
            } else if(obj.event === 'edit'){//
                //layer.alert('编辑行：<br>'+ JSON.stringify(data));
                $.cookie("orgDate",JSON.stringify(data));
                layer.open({
                    type: 2,
                    title:"机构信息",
                    shadeClose:true,
                    area: ['65%', '65%'],
                    content: '/marketing/goEditOrgInfo?id='+obj.data.id,
                    end:function () {
                        window.location.reload();
                    }
                });
            }else if (obj.event=='voucherEdit'){
                layer.open({
                    type: 2,
                    title:"优惠券",
                    shadeClose:true,
                    area: ['90%', '90%'],
                    offset: '0px',
                    content: '/marketing/goVoucherList?orgId='+obj.data.id,
                    end:function () {
                        window.location.reload();
                    }
                });
            }else if (obj.event=='activityActivityList'){
                layer.open({
                    type: 2,
                    title:"活动信息",
                    shadeClose:true,
                    offset: '0px',
                    area: ['95%', '95%'],
                    content: '/group/groupActivityList?orgId='+obj.data.id,
                    end:function () {
                        window.location.reload();
                    }
                });
            }else if(obj.event=='rebateStting'){
                layer.open({
                    type: 2,
                    title:"返利设置",
                    shadeClose:true,
                    offset: '30px',
                    area: ['50%', '50%'],
                    content: '/marketing/configRule?orgId='+obj.data.id,
                    end:function () {
                        window.location.reload();
                    }
                });
            }
        });

        var $ = layui.$, active = {
            getCheckData: function(){ //获取选中数据
                var checkStatus = table.checkStatus('idTest')
                    ,data = checkStatus.data;
                layer.alert(JSON.stringify(data));
            }
            ,getCheckLength: function(){ //获取选中数目
                var checkStatus = table.checkStatus('idTest')
                    ,data = checkStatus.data;
                layer.msg('选中了：'+ data.length + ' 个');
            }
            ,isAll: function(){ //验证是否全选
                var checkStatus = table.checkStatus('idTest');
                layer.msg(checkStatus.isAll ? '全选': '未全选')
            }
        };

        $('.demoTable .layui-btn').on('click', function(){
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });
    });

/*添加机构*/
        function addOrg() {
            $.cookie("orgDate",null);
            layer.open({
                type: 2,
                title:"机构信息",
                shadeClose:true,
                offset: '30px',
                area: ['75%', '75%'],
                content: '/marketing/goEditOrgInfo?orgId=${orgId}',
                end:function () {
                    window.location.reload();
                }
            });
        }



</script>





</body>
</html>
